import { DictDto } from './dict.dto';
import { ApiProperty } from "@nestjs/swagger";
import { MaxLength, IsString, IsNotEmpty, IsArray } from "class-validator";

export class CreateDictDto extends DictDto {
  @ApiProperty({ required: true, description: '字典标题' })
  @MaxLength(50, { message: '长度最大为50' })
  @IsString({ message: '字典名称必须为字符串类型' })
  @IsNotEmpty({ message: '字典不能为空' })
  readonly name: string;

  @ApiProperty({ required: true, description: '字典数据' })
  @IsArray({ message: '字典数据为数组类型' })
  @IsNotEmpty({ message: '字典数据不能为空' })
  readonly dictList: { [propsName: string]: any }[];
}